import { useState } from 'react'

function ControllerInput() {
  const [username, setUsername] = useState('汪哥')
  return (
    <>
      <div>
        <h2>受控组件</h2>
        <input
          type="text"
          value={username}
          onChange={(e) => {
            setUsername(e.target.value)
          }}
        />
        <div>您输入的用户名：{username}</div>
      </div>
    </>
  )
}

export default ControllerInput
